package com.spring.api.web.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.spring.api.web.dao.SmsReplyHistoryMapper;
import com.spring.api.web.model.SmsReplyHistory;
import com.spring.api.web.service.SmsReplyHistoryService;
import com.spring.security.web.model.BaseResult;

@Service
public class SmsReplyHistoryServiceImpl implements SmsReplyHistoryService {

	@Resource SmsReplyHistoryMapper smsReplyHistoryMapper;
	
	@Override
	public BaseResult deleteByPrimaryKey(String id) {
		BaseResult ret = new BaseResult();
		int isSuc = smsReplyHistoryMapper.deleteByPrimaryKey(id);
		if(isSuc==0){
			ret.setStatus("0").setMsg("删除失败");
		}else{
			ret.setMsg("删除成功");
		}
		return ret;
	}

	@Override
	public BaseResult insert(SmsReplyHistory record) {
		BaseResult ret = new BaseResult();
		int isSuc = smsReplyHistoryMapper.insert(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("保存失败");
		}else{
			ret.setMsg("保存成功");
		}
		return ret;
	}
	
	@Override
	public BaseResult insertByList(List<SmsReplyHistory> record){
		BaseResult ret = new BaseResult();
		int isSuc = smsReplyHistoryMapper.insertByList(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("保存失败");
		}else{
			ret.setMsg("保存成功");
		}
		return ret;
	}

	@Override
	public SmsReplyHistory selectByPrimaryKey(String id) {
		return smsReplyHistoryMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<SmsReplyHistory> selectByParm(SmsReplyHistory parm) {
		return smsReplyHistoryMapper.selectByParm(parm);
	}

	@Override
	public BaseResult updateByPrimaryKeySelective(SmsReplyHistory record) {
		BaseResult ret = new BaseResult();
		int isSuc = smsReplyHistoryMapper.updateByPrimaryKeySelective(record);
		if(isSuc==0){
			ret.setStatus("0").setMsg("更新失败");
		}else{
			ret.setMsg("更新成功");
		}
		return ret;
	}

}
